The returned results are specific to the indicated local establishment name, search engine, location and language parameters. We emulate set location and search engine with the highest accuracy so that the results you receive will match the actual search results for the specified parameters at the time of task setting. You can always check the returned results accessing the check_url in the Incognito mode to make sure the received data is entirely relevant. Note that user preferences, search history, and other personalized search factors are ignored by our system and thus would not be reflected in the returned results.
Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access
# Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access \
login="login" \
password="password" \
cred="$(printf ${login}:${password} | base64)" \
id="04011058-0696-0199-0000-2196151a15cb" \
curl --location --request GET "https://api.dataforseo.com/v3/reviews/google/task_get/${id}" \
--header "Authorization: Basic ${cred}" \
--header "Content-Type: application/json" \
<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
$client = new RestClient($api_url, null, 'login', 'password');
try {
$result = array();
// #1 - using this method you can get a list of completed tasks
// GET /v3/reviews/google/tasks_ready
$tasks_ready = $client->get('/v3/reviews/google/tasks_ready');
// you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if (isset($tasks_ready['status_code']) AND $tasks_ready['status_code'] === 20000) {
foreach ($tasks_ready['tasks'] as $task) {
if (isset($task['result'])) {
foreach ($task['result'] as $task_ready) {
// #2 - using this method you can get results of each completed task
// GET /v3/reviews/google/task_get/$id
if (isset($task_ready['endpoint'])) {
$result[] = $client->get($task_ready['endpoint']);
}
// #3 - another way to get the task results by id
// GET /v3/reviews/google/task_get/$id
/*
if (isset($task_ready['id'])) {
$result[] = $client->get('/v3/reviews/google/task_get/' . $task_ready['id']);
}
*/
}
}
}
}
print_r($result);
// do something with result
} catch (RestClientException $e) {
echo "\n";
print "HTTP code: {$e->getHttpCode()}\n";
print "Error code: {$e->getCode()}\n";
print "Message: {$e->getMessage()}\n";
print $e->getTraceAsString();
echo "\n";
}
$client = null;
?>
from client import RestClient
# You can download this file from here https://cdn.dataforseo.com/v3/examples/python/python_Client.zip
client = RestClient("login", "password")
# 1 - using this method you can get a list of completed tasks
# GET /v3/reviews/google/tasks_ready
response = client.get("/v3/reviews/google/tasks_ready")
# you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if response['status_code'] == 20000:
results = []
for task in response['tasks']:
if (task['result'] and (len(task['result']) > 0)):
for resultTaskInfo in task['result']:
# 2 - using this method you can get results of each completed task
# GET /v3/reviews/google/task_get/$id
if(resultTaskInfo['endpoint']):
results.append(client.get(resultTaskInfo['endpoint']))
'''
# 3 - another way to get the task results by id
# GET /v3/reviews/google/task_get/$id
if(resultTaskInfo['id']):
results.append(client.get("/v3/reviews/google/task_get/" + resultTaskInfo['id']))
'''
print(results)
# do something with result
else:
print("error. Code: %d Message: %s" % (response["status_code"], response["status_message"]))
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace DataForSeoDemos
{
public static partial class Demos
{
public static async Task reviews_google_task_get()
{
var httpClient = new HttpClient
{
BaseAddress = new Uri("https://api.dataforseo.com/"),
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
DefaultRequestHeaders = { Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes("login:password"))) }
};
// #1 - using this method you can get a list of completed tasks
// GET /v3/reviews/google/tasks_ready
var response = await httpClient.GetAsync("/v3/reviews/google/tasks_ready");
var tasksInfo = JsonConvert.DeserializeObject<<dynamic>>(await response.Content.ReadAsStringAsync());
var tasksResponses = new List<<object>>();
// you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if (tasksInfo.status_code == 20000)
{
if (tasksInfo.tasks != null)
{
foreach (var tasks in tasksInfo.tasks)
{
if (tasks.result != null)
{
foreach (var task in tasks.result)
{
if (task.endpoint != null)
{
// #2 - using this method you can get results of each completed task
// GET /v3/reviews/google/task_get/$id
var taskGetResponse = await httpClient.GetAsync((string)task.endpoint);
var taskResultObj = JsonConvert.DeserializeObject<<dynamic>>(await taskGetResponse.Content.ReadAsStringAsync());
if (taskResultObj.tasks != null)
{
var fst = taskResultObj.tasks.First;
// you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if (fst.status_code >= 40000 || fst.result == null)
Console.WriteLine($"error. Code: {fst.status_code} Message: {fst.status_message}");
else
tasksResponses.Add(fst.result);
}
// #3 - another way to get the task results by id
// GET /v3/reviews/google/task_get/$id
/*
var tasksGetResponse = await httpClient.GetAsync("/v3/reviews/google/task_get/" + (string)task.id);
var taskResultObj = JsonConvert.DeserializeObject<<dynamic>>(await tasksGetResponse.Content.ReadAsStringAsync());
if (taskResultObj.tasks != null)
{
var fst = taskResultObj.tasks.First;
// you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if (fst.status_code >= 40000 || fst.result == null)
Console.WriteLine($"error. Code: {fst.status_code} Message: {fst.status_message}");
else
tasksResponses.Add(fst.result);
}
*/
}
}
}
}
}
if (tasksResponses.Count > 0)
// do something with result
Console.WriteLine(String.Join(Environment.NewLine, tasksResponses));
else
Console.WriteLine("No completed tasks");
}
else
Console.WriteLine($"error. Code: {tasksInfo.status_code} Message: {tasksInfo.status_message}");
}
}
}
The above command returns JSON structured like this:
{
"version": "0.1.20200325",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1922 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "03271847-1535-0199-0000-a0625a4a5121",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0218 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"reviews",
"google",
"task_get",
"03271847-1535-0199-0000-a0625a4a5121"
],
"data": {
"api": "reviews",
"function": "task_get",
"se": "google",
"location_code": 2840,
"language_name": "English",
"keyword": "hedonism wines",
"depth": 10,
"device": "mobile",
"os": "ios"
},
"result": [
{
"keyword": "hedonism wines",
"type": "reviews",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.google.com/search?q=hedonism%20wines&num=10&sort=qualityScore&hl=en&gl=US&gws_rd=cr&ie=UTF-8&oe=UTF-8&uule=w+CAIQIFISCQs2MuSEtepUEUK33kOSuTsc",
"datetime": "2020-03-27 16:48:07 +00:00",
"title": "Hedonism Wines",
"sub_title": "3-7 Davies St, London, United Kingdom",
"rating": {
"rating_type": "Max5",
"value": 4.8,
"votes_count": null,
"rating_max": 5
},
"feature_id": "0x4876052ce9c2190f:0x4e1505095325804d",
"place_id": "ChIJDxnC6SwFdkgRTYAlUwkFFU4",
"cid": "194604053573767737",
"reviews_count": 694,
"items_count": 10,
"items": [
{
"type": "google_reviews_search",
"rank_group": 1,
"rank_absolute": 1,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]",
"review_text": "AMAZING. This place is probably one of the most beautiful wine shops in the world. Staffs are very knowledgeable. Lower-ground looks almost like a museum. You find bottles below 20 pounds, but also above 20K+ !",
"time_ago": "3 weeks ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 35,
"photos_count": 1,
"local_guide": true,
"profile_name": "jean-philippe Beaumont",
"profile_url": "https://www.google.com/maps/contrib/105325656928581566867?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARAe",
"profile_image_url": "https://lh3.googleusercontent.com/-5CUwLKPAPtM/AAAAAAAAAAI/AAAAAAAAAAA/SDKmDfjeF0c/s40-c-rp-mo-ba3-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 2,
"rank_absolute": 2,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[2]",
"review_text": "I just love this shop. The range of wines and spirits is incredible. It's almost like being in a museum. You will find the very best here. Rare and wonderful spirits. Friendly and informative staff too. I cannot wait to return!",
"time_ago": "3 months ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 18,
"photos_count": 14,
"local_guide": false,
"profile_name": "Dapper Gent",
"profile_url": "https://www.google.com/maps/contrib/118083049190396710333?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARAl",
"profile_image_url": "https://lh5.googleusercontent.com/-fS_TaOEyvo8/AAAAAAAAAAI/AAAAAAAAAAA/oj1riEt-Rco/s40-c-rp-mo-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 3,
"rank_absolute": 3,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[3]",
"review_text": "An extensive range of beverages and a surprising amount of character. Very helpful (but not intrusive) staff. I particularly liked the tasting area (it is of the 'put money on a card, then samples are priced' variety) - 48 things to try, samples priced from £1.50 to over £60 each.Two of their smaller areas are particularly creepy (in a way that I find appealing, but YMMV). One has many different hands holding the bottles on the wall (highlights include tentacles, android hands, and one with several finger puppets).The other is the creepy forest - I won't spoil it for you, go and look!As far as what they're actually selling, it is a large store with a lot of variety, spirits as well as wines.",
"time_ago": "3 months ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 61,
"photos_count": 1,
"local_guide": true,
"profile_name": "Sarah Kuklewicz",
"profile_url": "https://www.google.com/maps/contrib/103191467933908669359?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARAs",
"profile_image_url": "https://lh3.googleusercontent.com/-LIyj_uD31iw/AAAAAAAAAAI/AAAAAAAAAAA/kFHf8UHQ8e0/s40-c-rp-mo-ba5-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 4,
"rank_absolute": 4,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[4]",
"review_text": "Wine shop with an atmosphere. Great choice of wines from different regions, vintages and styles. Could browse it for ages! And the cellar with fine wines is a must visit. Also, knowledgeable (and not pretentious) staff ready to help.",
"time_ago": "4 months ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 24,
"photos_count": 12,
"local_guide": true,
"profile_name": "Natalija Marcinska",
"profile_url": "https://www.google.com/maps/contrib/114438019553136793528?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARA0",
"profile_image_url": "https://lh3.googleusercontent.com/-iMYAKSG1s0g/AAAAAAAAAAI/AAAAAAAAAAA/95_c22cfCis/s40-c-rp-mo-ba3-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 5,
"rank_absolute": 5,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[5]",
"review_text": "Just brilliant. Thank-you. After several misses trying to get the product I was after these guys popped up. Two days later Christmas saved. Excellent.",
"time_ago": "3 months ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 1,
"photos_count": 1,
"local_guide": false,
"profile_name": "Richard Dixon",
"profile_url": "https://www.google.com/maps/contrib/115758512535925349397?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARA7",
"profile_image_url": "https://lh5.googleusercontent.com/-iCDO5XOXTXw/AAAAAAAAAAI/AAAAAAAAAAA/EUugDRznU0o/s40-c-rp-mo-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 6,
"rank_absolute": 6,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[6]",
"review_text": "Probably the best wine and spirits shop in the world. Incredible!",
"time_ago": "2 weeks ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 24,
"photos_count": null,
"local_guide": false,
"profile_name": "Stu",
"profile_url": "https://www.google.com/maps/contrib/115556120202037600827?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARBC",
"profile_image_url": "https://lh4.googleusercontent.com/-l8jdHwufZmI/AAAAAAAAAAI/AAAAAAAAAAA/E_slW47LWWc/s40-c-rp-mo-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 7,
"rank_absolute": 7,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[7]",
"review_text": "Very helpful, knowledgeable and friendly with many staff coming from different parts of the world to give a real depth of information and insight into wines from around the globe. A shame tastings can't be done so we were told unless £100 was paid. Well laid out store though and a fair selection of spirits too in addition to a huge range of reds 🤩. Not to be compared with the price range of a Majestice store - you could easily spend a lot of money on Hedonism Wines so be warned!",
"time_ago": "2 months ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 118,
"photos_count": 111,
"local_guide": true,
"profile_name": "Jason W",
"profile_url": "https://www.google.com/maps/contrib/107389485035408886234?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARBJ",
"profile_image_url": "https://lh3.googleusercontent.com/-WwvEsHOd9TQ/AAAAAAAAAAI/AAAAAAAAAAA/dM9Y4epFllM/s40-c-rp-mo-ba4-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 8,
"rank_absolute": 8,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[8]",
"review_text": "Great selection of alcohol (wine and spirits) and knowledgeable staff. I've never been disappointed.",
"time_ago": "a month ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 44,
"photos_count": 23,
"local_guide": true,
"profile_name": "E. A.",
"profile_url": "https://www.google.com/maps/contrib/109672103031778494963?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARBR",
"profile_image_url": "https://lh5.googleusercontent.com/-Ii_brW667vU/AAAAAAAAAAI/AAAAAAAAAAA/gYiGQnH2wk4/s40-c-rp-mo-ba3-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 9,
"rank_absolute": 9,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[9]",
"review_text": "Great location great service you want wines they have wines great wines",
"time_ago": "a month ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 580,
"photos_count": 587,
"local_guide": true,
"profile_name": "Smon Bere",
"profile_url": "https://www.google.com/maps/contrib/116829460127017698014?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARBY",
"profile_image_url": "https://lh4.googleusercontent.com/-UqLcXm9cVaQ/AAAAAAAAAAI/AAAAAAAAAAA/x_--9EbL0cE/s40-c-rp-mo-ba6-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
},
{
"type": "google_reviews_search",
"rank_group": 10,
"rank_absolute": 10,
"position": "right",
"xpath": "/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[10]",
"review_text": "Impressive shop with almost everything you can imagine. Will definitely come back for the tasting room.",
"time_ago": "3 months ago",
"timestamp": "2019-11-15 12:57:46 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
},
"reviews_count": 1,
"photos_count": null,
"local_guide": false,
"profile_name": "Daniele",
"profile_url": "https://www.google.com/maps/contrib/107659777286444885184?hl=en-VN&sa=X&ved=2ahUKEwi6-ejsjbvoAhWGGuwKHfNZCCkQvvQBegQIARBf",
"profile_image_url": "https://lh6.googleusercontent.com/-pjRlEUA_PSQ/AAAAAAAAAAI/AAAAAAAAAAA/0sx4g_6wcr8/s40-c-rp-mo-br100/photo.jpg",
"owner_answer": null,
"owner_time_ago": null
}
]
}
]
}
]
}
Description of the fields for sending a request:
Field name
Type
Description
id
string
task identifier unique task identifier in our system in the UUID format
you will be able to use it within 30 days to request the results of the task at any time
As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.
Description of the fields in the results array:
Field name
Type
Description
version
string
the current version of the API
status_code
integer
general status code
you can find the full list of the response codes here Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions
status_message
string
general informational message
you can find the full list of general informational messages here
time
string
execution time, seconds
cost
float
total tasks cost, USD
tasks_count
integer
the number of tasks in the tasks array
tasks_error
integer
the number of tasks in the tasks array that were returned an error
tasks
array
array of tasks
id
string
task identifier unique task identifier in our system in the UUID format
status_code
integer
status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
status_message
string
informational message of the task
you can find the full list of general informational messages here
time
string
execution time, seconds
cost
float
cost of the task, USD
result_count
integer
number of elements in the result array
path
array
URL path
data
array
contains the same parameters that you specified in the POST request
result
array
array of results
keyword
string
keyword received in a POST array keyword is returned with decoded %## (plus symbol ‘+’ will be decoded to a space character)
type
string
search engine type in a POST array
se_domain
string
search engine domain in a POST array
location_code
integer
location code in a POST array
language_code
string
language code in a POST array
check_url
string
direct URL to search engine results
you can use it to make sure that we provided accurate results
datetime
string
date and time when the result was received
in the UTC format: “yyyy-mm-dd hh-mm-ss +00:00”
example: 2019-11-15 12:57:46 +00:00
title
string
title of the ‘reviews’ element in SERP
the name of the local establishment for which the reviews are collected
sub_title
string
subtitle of the ‘reviews’ element in SERP
additional information (e.g., address) on the ‘reviews’ element for which the reviews are collected
rating
array
rating of the corresponding local establishment
popularity rate based on reviews and displayed in SERP
rating_type
string
type of rating
here you can find the following elements: Max5, Percents, CustomMax
value
float
the average rating based on all reviews
votes_count
integer
the number of votes
rating_max
integer
the maximum value for a rating_type
feature_id
string
the unique identifier of the ‘reviews’ element in SERP